<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>闰年判断</title>
</head>
<body>
    
    <script>

        function isRunNian(year){
            if(year%100 == 0)
            {
                if(year%400 == 0){
                    return true;
                }
                else{
                    return false;
                }
            }
            else{
                if(year%4 == 0){
                    return true;
                }
                else{
                    return false;
                }
            }
        }

        var result = isRunNian(1900);
        console.log(result);

       //方法2
       function isRunNian2(year){
           if(year%4 == 0 && year%100 != 0 || year%400 == 0){
               return true;
           }
           else{
               return false;
           }
       }

       var result2 = isRunNian2(1991);
       console.log(result2);

    </script>

</body>
</html>